/**
 * Created by cb-dlhis on 17-1-17.
 */

import { GET_INFO, PUT_INFO } from './Domain';

export function getHotelInfoAPI (params, cb) {
  if (!params.pageNo) {
    return GET_INFO('/admin/hotel/hotelInfo', cb);
  } else {
    return GET_INFO('/admin/hotel/hotelInfo?page='+ params.pageNo +'&searchKey=' + params.searchKey, cb);
  }
}

export function postForFreeAPI (params, cb) {
  return PUT_INFO('/admin/hotel/expire/forfree', params, cb);
}

export function getHotelSecretAPI (params, cb) {
  return GET_INFO('/admin/hotel/secretinfo?hotelId=' + params.hotelId, cb);
}

export function getHotelOrdersAPI (params, cb) {
  return GET_INFO('/admin/hotel/brief/orderInfo?hotelId='+ params.hotelId + '&page=' + params.pageNo, cb);
}

export function getSecretOperateAPI (params, cb) {
  return GET_INFO('/admin/hotel/secret/operate?secretno='+ params.secretNo + '&isActive=' + params.sta, cb);
}

export function getHotelListBySearchKey (params, cb) {
  return GET_INFO('/admin/hotel/search/hotel?searchKey='+ params.searchKey, cb);
}
